package com.qf.service.impl;

import com.qf.entity.Permission;
import com.qf.entity.User;
import com.qf.mapper.AutoMapper;
import com.qf.service.IAutoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @propram: IntelliJ IDEA
 * @description:
 * @author: 秦先发
 * @create: 2021-09-27 19:17
 **/
@Service
public class AutoService implements IAutoService {
@Autowired
    private AutoMapper autoMapper;
    @Override
    public List<Permission> selectAllJson() {
        return autoMapper.selectAllJson();
    }

    @Override
    public Permission getById(Integer id) {
        return autoMapper.getById(id);
    }

    @Override
    public List<User> selectRoleUser(Integer rid) {
        return autoMapper.selectRoleUser(rid);
    }

    @Override
    public int deleteUsers(Integer rid, List<User> users) {
        return autoMapper.deleteUsers(rid,users);
    }

    @Override
    public int addRoleByUser(Integer rid, List<User> users) {
        return autoMapper.addRoleByUser(rid,users);
    }

    @Override
    public List<Integer> selectPermissionByRid(Integer rid) {
        return autoMapper.selectPermissionByRid(rid);
    }

    @Override
    public int addRoleByPermission(Integer rid, List<Integer> pids) {
        return autoMapper.addRoleByPermission(rid,pids);
    }

    @Override
    public int deleteRoleByPermission(Integer rid) {
        return autoMapper.deleteRoleByPermission(rid);
    }
}
